package structure.flyweight;

public class FlyWeightDemo {
    public static void main(String[] args) {
   
        // 使用享元工厂创建享元对象
        CityFlyWeight city1 = CityFlyWeightFactory.getFlyWeight("house_北京");
        CityFlyWeight city2 = CityFlyWeightFactory.getFlyWeight("house_上海");
        CityFlyWeight city3 = CityFlyWeightFactory.getFlyWeight("house_广州");
        CityFlyWeight city4 = CityFlyWeightFactory.getFlyWeight("house_深圳");
        CityFlyWeight city5 = CityFlyWeightFactory.getFlyWeight("house_杭州");
        CityFlyWeight city6 = CityFlyWeightFactory.getFlyWeight("house_武汉");
        CityFlyWeight city7 = CityFlyWeightFactory.getFlyWeight("house_南京");
        CityFlyWeight city8 = CityFlyWeightFactory.getFlyWeight("house_成都");
        CityFlyWeight city9 = CityFlyWeightFactory.getFlyWeight("house_重庆");
        CityFlyWeight city10 = CityFlyWeightFactory.getFlyWeight("street_柳州路");
        CityFlyWeight city11 = CityFlyWeightFactory.getFlyWeight("street_西安路");
        CityFlyWeight city12 = CityFlyWeightFactory.getFlyWeight("street_郑州路");
        CityFlyWeight city13 = CityFlyWeightFactory.getFlyWeight("street_大连路");
        CityFlyWeight city14 = CityFlyWeightFactory.getFlyWeight("street_青岛路");
        CityFlyWeight city15 = CityFlyWeightFactory.getFlyWeight("street_济南路");
        CityFlyWeight person = CityFlyWeightFactory.getFlyWeight("person_小明");
        CityFlyWeight person2 = CityFlyWeightFactory.getFlyWeight("person_小刚");
        city1.operation("北京欢迎您啊！");
        CityFlyWeight city_beijing = CityFlyWeightFactory.getFlyWeight("house_北京");
        city_beijing.operation("北京欢迎您啊！");
        city2.operation("上海欢迎您啊！");
        person.operation("小明喜欢上海");

    }
}
